package com.lobo.blog.mappers;

import com.lobo.blog.entity.Blog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @authoer:MacieSerenity
 * @createDate: 2022/10/4
 * @description:
 */
@Mapper
public interface BlogMapper {

    Blog getBlogById(@Param("blogId") int blogId);

    List<Blog> getAllBlogByList();

    List<Blog> getAllBlogByCondition(@Param("blog") Blog blog);

    List<Blog> getRecentNewBlogBySize(@Param("size") Integer size);

    List<Blog> getBlogsByQuery(@Param("query") String query);

    Integer updateViews(@Param("blogId") Integer blogId);

    List<Integer> getBlogIdsByTagId(@Param("tagId") Integer tagId);

    List<Blog> getBlogsByTagId(@Param("tagIds") List<Integer> tagIds);

    List<String> selectBlogsGroupByYear();

    List<Blog> selectBlogsByYear(@Param("year") String year);

    Integer getBlogCount();
}
